<template>
  <div class="product-container">
    <div class="header">
      <div class="pro-img">
        <img :src="require(`../../assets/${imgSrc}`)" alt="" />
      </div>
      <div class="pro-content">
        <div class="pro-title">【图像识别OCR】简单图片识别</div>
        <div class="pro-desc">适用于大图文字简单提取凑字数凑字数两行</div>
      </div>
    </div>
    <div class="body">
      <div class="left">
        <div class="price-container">
          <span>低至:</span>
          <div class="price">￥0.02元/次</div>
        </div>
        <div class="desc">识别1张1个平台计1次调用</div>
      </div>
      <RouterLink to="Detail">
        <div class="right">查看详情</div>
      </RouterLink>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      data() {},
    };
  },
  props: {
    imgSrc: {
      type: String,
      default: "service/test.png",
    },
  },
};
</script>

<style scoped lang="less">
@import "~@/styles/var.less";
.product-container {
  width: 288px;
  box-shadow: 0px 0px 12px 0px rgba(0, 0, 0, 0.08);
  border-radius: 12px;
  border: 1px solid #ededed;
  box-sizing: border-box;
  transition: 0.3s;
  height: 192px;
  &:hover {
    transform: translateY(-12px);
    .pro-title {
      color: @primary !important;
    }
  }
  .header {
    display: flex;
    column-gap: 12px;
    align-items: center;
    width: 288px;
    height: 120px;
    padding: 16px;
    box-sizing: border-box;
    .pro-img {
      width: 64px;
      height: 64px;
      border-radius: 4px;
      overflow: hidden;
      flex: 0 0 auto;
      img {
        width: 100%;
        height: 100%;
        object-fit: cover;
      }
    }
    .pro-content {
      display: flex;
      flex-direction: column;
      row-gap: 4px;
      flex: 1 1 auto;
      .pro-title {
        color: #333;
        overflow: hidden;
        text-overflow: ellipsis;
        display: -webkit-box;
        -webkit-line-clamp: 2; /* 可以显示的行数，超出部分用...表示*/
        -webkit-box-orient: vertical;
      }
      .pro-desc {
        color: #666666;
        font-size: 14px;
        overflow: hidden;
        text-overflow: ellipsis;
        display: -webkit-box;
        -webkit-line-clamp: 2; /* 可以显示的行数，超出部分用...表示*/
        -webkit-box-orient: vertical;
      }
    }
  }
  .body {
    display: flex;
    width: 288px;
    height: 72px;
    background: #f9f9f9;
    border-radius: 0px 0px 12px 12px;
    border: 1px solid #ededed;
    padding: 12px 16px;
    box-sizing: border-box;
    align-items: center;
    justify-content: space-between;
    .left {
      display: flex;
      flex-direction: column;
      row-gap: 8px;
      .price-container {
        display: flex;
        column-gap: 10px;
        span {
          color: #666666;
          font-size: 14px;
        }
        .price {
          color: @primary;
        }
      }
      .desc {
        color: #999999;
        font-size: 12px;
        overflow: hidden;
        text-overflow: ellipsis;
        display: -webkit-box;
        -webkit-line-clamp: 1; /* 可以显示的行数，超出部分用...表示*/
        -webkit-box-orient: vertical;
      }
    }
    .right {
      width: 80px;
      height: 28px;
      line-height: 28px;
      background: @primary;
      border-radius: 4px;
      font-size: 14px;
      color: #ffffff;
      text-align: center;
    }
  }
}
</style>